<template>
  <div class="wrapper">
    <swiper :options="swiperOption">
      <swiper-slide class="slide_a" v-for="a in swiperList" :key="a.id"><img :src="a.imgUrl" alt=""></swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>
<script>
export default {
  name: 'HomeSwiper',
  props: {
    swiperList: Array // 接受父组件传递过来的数据
  },
  data () {
    return {
      swiperOption: {
        // swiper参数 和官网一模一样
        autoplay: 1500,
        pagination: '.swiper-pagination',
        loop: true
      }
    }
  }
}
</script>

<style lang="stylus" scoped>
  //样式穿透
  .wrapper >>> .swiper-pagination-bullet-active{
    background:#ffffff !important;
  }
  .wrapper{
    overflow :hidden;
    width: 100%;
    height:0;
    padding-bottom:28.4%;
    .slide_a img{
      width: 100%;
    }
  }
</style>
